<template>
    <div>
        <ul class="mui-table-view">
            <li class="mui-table-view-cell mui-media" v-for="item in newlist" :key="item.id">
                <router-link :to="'/home/newsinfo/' + item.id">
                    <img class="mui-media-object mui-pull-left" :src="item.img">
                    <div class="mui-media-body">
                        {{item.tittle}}
                        <p class='mui-ellipsis'><span>点击次数：{{item.click}}</span> <span>发表时间：{{item.add_time | dateFormat}}</span></p>
                    </div>
                </router-link>
            </li>
        </ul>
    </div>
</template>

<script>
    import { Toast } from 'mint-ui'
    export default {
        //name: "Newlist"
  data(){
      return{
          newlist:[]
      }
  },
        created(){
        this.getNewsList()
        },
        methods:{
      getNewsList(){
          this.$http.get('java/news/getnewslist1.json').then(result=>{
              if (result.body.status === 0){
                  this.newlist = result.body.message
              }
              else {
                  Toast('加载数据失败')
              }
          })
      }
        }
    }
</script>

<style scoped lang="scss">

</style>